<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Building a GBA ROM File</title>
<link href="css/tutorial.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="css/precodeformat.js"></script>
</head>

<body onload="PreCodeFormat()">
<div id="content">
<h1>Building a GBA ROM File</h1>

<p>
After you've successfully exported your project in Spritely, you're now ready to build the
GBA ROM file from the exported data. This tutorial will show you how to do that
using the DOS command prompt.
</p>

<p>
You can also build/run your project from within Programmer's Notepad.
See
<a href="using_pn.html">Using Programmer's Notepad</a>
for more information.
</p>

<hr/>

<h2>Step 1 : Launch a DOS command prompt</h2>

<p>
First, click on the "Start" menu in the lower left corner of your screen.
</p>

<p>
This will pull up a menu that should look something like one of the examples shown here.
</p>

<p><img src="build_gba_rom/build_rom_01.png" /></p>
<p>or</p>
<p><img src="build_gba_rom/build_rom_02.png" /></p>

<p>
Find the "Run..." command near the bottom of this menu and click on it.
</p>

<p>
This will bring up the "Run" dialog.
</p>

<p><img src="build_gba_rom/build_rom_03.png" /></p>

<p>
Enter cmd into the edit field and press the "OK" button.
</p>

<p>
This will bring up a "Command Prompt" that will allow you to enter the commands needed
to build your GBA project.
</p>

<p><img src="build_gba_rom/build_rom_04.png" /></p>

<h2>Step 2 : Go to your project's directory</h2>

<p>
Unfortunately, it starts out in the wrong directory, so we'll need to go to
the correct directory before we can build.
</p>

<p>
Use the <tt>cd</tt> ("change directory") command to go to your project's directory:
</p>

<pre>   cd \gamedev\projects\mygame</pre>

<p>Note the space between <tt>cd</tt> and <tt>\</tt>.</p>

<p>
Also, you'll need to replace "mygame" with the name you chose earlier when exporting
your project.
</p>

<p>
Make sure to press the "Enter" key after you type in the command.
</p>

<p><img src="build_gba_rom/build_rom_05.png" /></p>

<h2>Step 3 : <tt>Make</tt> your project</h2>

<p>
Once you're in the correct directory, type:
</p>

<pre>   make</pre>

<p>
and press Enter.
</p>

<p><img src="build_gba_rom/build_rom_06.png" /></p>

<p>You'll see a bunch of messages printed out in the Command Prompt window that you can
ignore (for now).
</p>

<p><img src="build_gba_rom/build_rom_07.png" /></p>

<p>
The only important parts are the last 2 lines, which should say
</p>

<pre>   built ... mygame.gba
   ROM fixed!</pre>

<p>
if the build was successful.
</p>

<h2>Finished!</h2>

<p>
If you open your project directory, you'll see the new files that were created.
</p>

<p><img src="build_gba_rom/build_rom_08.png" /></p>

<blockquote><tt>build/</tt> &mdash; This directory contains temporary files that the compiler used when building the ROM file. </blockquote>
<blockquote><tt>mygame.elf</tt> &mdash; This is another temporary file.</blockquote>
<blockquote><tt>mygame.gba</tt> &mdash; This is the ROM file that contains your game!</blockquote>

<p>
You're now ready to run your ROM and see how your sprite looks.
</p> 

<div id="footer_bkgd"><div id="footer">
<p>Copyright &copy;2008-9 Gary Kacmarcik</p>
</div></div>

</div>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1163903-2");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>
